<?php
require_once SERVER_ROOT.'/tools/smarty/Smarty.class.php';
class Tools_Dismarty extends Smarty {
    public $template;
    public $view = array();
    public function  __construct($template) {
        $this->template_dir = SERVER_ROOT.'/view/templates';
        $this->compile_dir = SERVER_ROOT.'/view/templates_c';
        $this->config_dir = SERVER_ROOT.'/config/';
        $this->cache_dir = SERVER_ROOT.'/tmp/';
        $this->template = $template;
    }
    public function assignArray() {
        foreach($this->view as $key => $val) {
            $this->assign($key,$val);
        }
    }
    public function displayShow() {
        $this->assignArray();
        $this->assign('template',$this->template);
        $this->display('body.html');
    }
    public function getTemplate() {
        $this->assignArray();
        return $this->fetch($this->template);
    }
}
?>